<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt-br" xml:lang="pt-br"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">  
    <ui:composition template="../template.xhtml">
        <ui:define name="tituloPagina">
            #{msgs.inserir} #{msgs.aluno}
        </ui:define>

        <ui:define name="conteudo">
            <p class="valoresCabecalho">
             #{msgs.inserir} #{msgs.aluno}   
            </p>
            <h:form>
                <h:panelGrid class="panelGrid" columns="3">
                    #{msgs.nome}:
                    <h:inputText id="nome" value="#{beanAluno.aluno.nome}" 
                                 size="40" required="true"
                                 label="Nome" >
                        <f:validateLength minimum="3" maximum="50" />
                    </h:inputText>
                    <h:message for="nome" style="color:red" />    
                    Email:
                    <h:inputText id="email" value="#{beanAluno.aluno.email}" 
                                 size="40" required="true"
                                 label="Email" >
                        <f:validateLength minimum="5" maximum="30" />
                    </h:inputText>
                    <h:message for="email" style="color:red" />    
                    #{msgs.sexo}:
                    <h:selectOneRadio id="sexo" value="#{beanAluno.aluno.sexo}" title="Sexo" required="true" label="Sexo">
                        <f:selectItem id="sm" itemLabel="#{msgs.Masculino}" itemValue="M" />
                        <f:selectItem id="sf" itemLabel="#{msgs.Feminino}" itemValue="F" />
                    </h:selectOneRadio>
                    <h:message for="sexo" style="color:red" />    
                    CPF:
                    <h:inputText id="cpf" value="#{beanAluno.aluno.cpf}" 
                                 size="11" required="true"
                                 label="CPF" >                       
                    </h:inputText>
                    <h:message for="cpf" style="color:red" />    
                    RG:
                    <h:inputText id="rg" value="#{beanAluno.aluno.rg}" 
                                 size="15" required="true"
                                 label="RG" >
                        <f:validateLength minimum="5" maximum="15" />
                    </h:inputText>
                    <h:message for="rg" style="color:red" />
                    #{msgs.telefone}:
                    <h:inputText id="telefone" value="#{beanAluno.aluno.telefone}" 
                                 size="15" required="true"
                                 label="Telefone" >
                        <f:validateLength minimum="6" maximum="15" />
                    </h:inputText>
                    <h:message for="telefone" style="color:red" />
                </h:panelGrid>           
                <h:commandButton value="#{msgs.inserir}" action="#{beanAluno.inserir}"/>
                <h:commandButton value="#{msgs.cancelar}" id="cancelarinsercao" action="#{beanAluno.cancelar}" immediate="true"/>
            </h:form>
                
        </ui:define>

    </ui:composition>
</html>